<?php

class registerAction extends sfAction {

    public function execute($request) {
	$this->setLayout('login');
        $this->form = new KupacForm();
        if ($request->isMethod('post')) {
            $this->processForm($request, $this->form);
        }
    }

    protected function processForm(sfWebRequest $request, sfForm $form) {
        $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
        if ($form->isValid()) {
            $oblast = $form->save();

            $this->redirect('page/index');
        }
    }

}

?>
